package com.itlong.cloud.project.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateDeviceAuthCodeGetDevicePageDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateDeviceAuthCodeGetPageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceAuthCodeGetDevicePageVO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceAuthCodeGetPageVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <desc>
 *      设备授权码管理暴露接口
 * </desc>
 *
 * @createDate 2019/01/16
 */
@FeignClient(name = "project-service")
public interface IOperateDeviceAuthCodeServiceClient {

    /**
     * <desc>
     *      分页获取设备授权码
     * </desc>
     *
     * @param operateDeviceAuthCodeGetPageDTO 获取设备授权码列表DTO
     * @return 分页获取结果
     * @author wangzhi
     * @createDate 2019/01/16
     */
    @PostMapping(path = "operate/deviceAuthCode/getPage")
    Page<OperateDeviceAuthCodeGetPageVO> getPage(@RequestBody OperateDeviceAuthCodeGetPageDTO operateDeviceAuthCodeGetPageDTO) throws Exception;

    /**
     * <desc>
     *      新增设备授权码
     * </desc>
     *
     * @param baiduAuthCode 百度识别授权码，多个用英文逗号相连
     * @return 1成功，0失败
     * @author wangzhi
     * @createDate 2019/01/16
     */
    @PostMapping(path = "operate/deviceAuthCode/saveDeviceAuthCode")
    Integer saveDeviceAuthCode(@RequestParam("baiduAuthCode") String baiduAuthCode) throws Exception;

    /**
     * <desc>
     *      查询单个设备授权码
     * </desc>
     *
     * @param operateDeviceAuthCodeGetPageDTO 获取设备授权码列表DTO
     * @return 单个设备授权码
     * @author wangzhi
     * @createDate 2019/01/21
     */
    @PostMapping(path = "operate/deviceAuthCode/getOne")
    OperateDeviceAuthCodeGetPageVO getOne(@RequestBody OperateDeviceAuthCodeGetPageDTO operateDeviceAuthCodeGetPageDTO) throws Exception;

    /**
     * <desc>
     *      获取设备授权码相关设备列表
     * </desc>
     *
     * @param operateDeviceAuthCodeGetDevicePageDTO 获取设备授权码相关设备列表DTO
     * @return 获取设备授权码相关设备列表分页结果
     * @author wangzhi
     * @createDate 2019/03/12
     */
    @PostMapping(path = "operate/deviceAuthCode/getDevicePage")
    Page<OperateDeviceAuthCodeGetDevicePageVO> getDevicePage(@RequestBody OperateDeviceAuthCodeGetDevicePageDTO operateDeviceAuthCodeGetDevicePageDTO) throws Exception;

    /**
     * <desc>
     *      购买（设备绑定设备授权码）
     * </desc>
     *
     * @param projectId 项目编号
     * @param deviceUnique 设备序列号，多个逗号相连
     * @return 0-失败 1-成功
     * @author wangzhi
     * @createDate 2019/03/12
     */
    @PostMapping(path = "operate/deviceAuthCode/buy")
    Integer buy(@RequestParam("projectId") String projectId, @RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *      解绑（设备与设备授权码解除绑定）
     * </desc>
     *
     * @param operateDeviceAuthCodeGetPageDTO 获取设备授权码列表DTO
     * @return 0-失败 1-成功
     * @author wangzhi
     * @createDate 2019/03/12
     */
    @PostMapping(path = "operate/deviceAuthCode/unbind")
    Integer unbind(@RequestBody OperateDeviceAuthCodeGetPageDTO operateDeviceAuthCodeGetPageDTO) throws Exception;
}
